package com.example.myweb.Dto;

import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

@Data
public class CreateArticleDTO {
    @NotBlank(message = "文章标题不能为空")
    @Size(max = 255, message = "标题过长")
    private String title;

    @NotBlank(message = "文章内容不能为空")
    private String content;

    @NotNull(message = "必须选择一个分类")
    private Integer categoryId;

    private String coverImageUrl; // 可选
    private List<String> topics;

    @Valid
    private PollCreateDTO poll;
}